﻿using System;
using System.IO;



namespace Kernelx.Contexts.Core
{

    /// <summary>
    /// 
    /// </summary>
    public class FileWrapper
    {
        #region 属性

        /// <summary>
        /// 
        /// </summary>
        public string Name { get; }

        /// <summary>
        /// 
        /// </summary>
        public string FileName { get; }

        /// <summary>
        /// 
        /// </summary>
        public string ContentType { get; }

        /// <summary>
        /// 
        /// </summary>
        public long Length { get; }

        /// <summary>
        /// 
        /// </summary>
        public Func<Stream> OpenReadStream { get; }
        #endregion


        /// <summary>
        /// 
        /// </summary>
        /// <param name="name"></param>
        /// <param name="fileName"></param>
        /// <param name="contentType"></param>
        /// <param name="length"></param>
        /// <param name="openReadStream"></param>
        public FileWrapper(string name, string fileName, string contentType, long length, Func<Stream> openReadStream)
        {
            Name = name;
            FileName = fileName;
            ContentType = contentType;
            Length = length;
            OpenReadStream = openReadStream;
        }
    }
}
